<!-- index.html -->
{% load static %}
<!DOCTYPE html>
<html>
<head>
    <title>网络投票</title>
    <link rel="stylesheet" href="{% static 'polls/style.css' %}">
</head>
<div class="admin-header">
    <a href="{% url 'admin:index' %}" class="admin-btn">后台管理</a>
</div>
<body>
    <h1 class="page-title">网络投票应用</h1>
    <h2 class="page-subtitle">快来参与有趣的投票吧！</h2>
    <div class="container">
        <div class="poll-list">
            {% if latest_question_list %}
                {% for question in latest_question_list %}
                <div class="poll-card">
                    <div class="poll-header">
                        <h2>{{ forloop.counter }}、{{ question.question_text }}</h2>
                    </div>
                    <div class="poll-actions">
                        <a href="{% url 'polls:detail' question.id %}" class="vote-btn">投票</a>
                        <a href="{% url 'polls:results' question.id %}" class="result-btn">查看结果</a>
                    </div>
                </div>
                {% endfor %}
            {% else %}
                <p class="no-polls">暂无投票</p>
            {% endif %}
        </div>
    </div>
</body>
</html>